1
'*************************** Module Header ******************************'
2 ' Project: VBSoftKeyboard
3 ' Copyright (c) Microsoft Corporation.
5 ' This class contains the structures and the constants which are used in
6 ' the SendInput method.
9 ' This source is subject to the Microsoft Public License.
10 ' See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
11 ' All other rights reserved.
13 ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
14 ' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
15 ' WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
16 '*************************************************************************'
19 Imports System
.Runtime
.InteropServices
21 Namespace UserInteraction
22 Friend NotInheritable Class NativeMethods
24 ' The constants used in the INPUT structure.
25 Public Const INPUT_MOUSE
As Integer = 0
26 Public Const INPUT_KEYBOARD
As Integer = 1
27 Public Const INPUT_HARDWARE
As Integer = 2
29 ' The constants used in the KEYBDINPUT structure.
30 Public Const KEYEVENTF_EXTENDEDKEY
As Integer = &H1
31 Public Const KEYEVENTF_KEYUP
As Integer = &H2
34 ''' Used by SendInput to store information for synthesizing input events such
35 ''' as keystrokes, mouse movement, and mouse clicks.
36 ''' http://msdn.microsoft.com/en-us/library/ms646270(VS.85).aspx
38 <StructLayout(LayoutKind
.Sequential
)> _
39 Public Structure INPUT
45 Public type As Integer
46 Public inputUnion
As NativeMethods
.INPUTUNION
51 ''' An INPUTUNION structure only contains one field.
52 ''' http://msdn.microsoft.com/en-us/library/ms646270(VS.85).aspx
54 <StructLayout(LayoutKind
.Explicit)> _
55 Public Structure INPUTUNION
57 Public hi
As NativeMethods
.HARDWAREINPUT
59 Public ki
As NativeMethods
.KEYBDINPUT
61 Public mi
As NativeMethods
.MOUSEINPUT
65 ''' The information about a simulated hardware event.
66 ''' http://msdn.microsoft.com/en-us/library/ms646269(VS.85).aspx
68 <StructLayout(LayoutKind
.Sequential
)> _
69 Public Structure HARDWAREINPUT
70 Public uMsg
As Integer
71 Public wParamL
As Short
72 Public wParamH
As Short
76 ''' The information about a simulated keyboard event.
77 ''' http://msdn.microsoft.com/en-us/library/ms646271(VS.85).aspx
79 <StructLayout(LayoutKind
.Sequential
)> _
80 Public Structure KEYBDINPUT
83 Public dwFlags
As Integer
84 Public time
As Integer
85 Public dwExtraInfo
As IntPtr
89 ''' The information about a simulated mouse event.
90 ''' http://msdn.microsoft.com/en-us/library/ms646273(VS.85).aspx
92 <StructLayout(LayoutKind
.Sequential
)> _
93 Public Structure MOUSEINPUT
96 Public mouseData
As Integer
97 Public dwFlags
As Integer
98 Public time
As Integer
99 Public dwExtraInfo
As IntPtr